Over the past several years there have been increasing demands placed upon graphics subsystems in all variety of hardware. For example, in the general computing area, even traditionally mundane programs, like presentation software, are including animation and other tools that are requiring faster and more complex graphics computation. In addition, the traditional graphics-intense applications like video, photo editing and gaming are growing both in scope and graphics-intensity.
During this same time period, hardware manufacturers have sought to meet and exceed the growing demand with dedicated programmable graphics processors having ever-increasing capability. While both programmable and non-programmable GPUs offer enhanced speed for graphics calculations, programmable GPUs differ in that they offer a high measure of flexibility. In practical terms, programmability is an important advantage because it allows programs to use the graphics chip in ways similar to the system microprocessor. By using the GPU this way, the system can generate virtually infinite graphics effects without loading the system CPU.
Programmable GPUs run programs that are generally called fragment programs. The name “fragment” program derives from the fact that the unit of data being operated upon is generally a pixel, i.e., a fragment of an image. The GPUs can run a fragment program on several pixels simultaneously to create a result, which is generally referred to by the name of the buffer in which it resides. GPUs use data input generally called textures, which is analogous to a collection of pixels.
As computers migrate toward more visually rich content, image processing becomes more important. As a consequence, the programmer's ease of accessing these tools and the efficiency of graphics calculations continues to grow in importance. It is therefore desirable to have an abstraction layer that hides the complexity of graphics hardware from those exploiting that infrastructure. Furthermore, operating systems may wish to facilitate an overall rich user graphics experience by presenting such an abstraction layer to all applications. In Apple Inc.'s OS X operating system, such an abstraction layer is presented in the CoreImage framework.
In broad terms, the CoreImage framework allows a programmer or program to simply apply one or more filters or effects to a given image. This sequence of filters can be assembled into a graph-like description of an image rendering task. This description is known as a render tree. Once the render tree is created, a fragment program is generated compiled and linked to perform the required graphics operations. Although modern programmable GPUs are able to perform such functions quite quickly, it still requires a significant amount of time to generate, compile and link the fragment programs for each successive frame. However, it is not uncommon for the rendering of successive frames to require the use of substantially the same fragment programs. It would therefore be desirable to provide a way of reusing a previously generated, compiled, and linked fragment program to improve the speed of graphics rendering operations.